package v1

import "github.com/gogf/gf/v2/frame/g"

type PortHelper struct {
	HostIp        string `json:"hostIp"`
	HostPort      string `json:"hostPort"`
	ContainerPort string `json:"containerPort"`
	Protocol      string `json:"protocol"`
}

type VolumeHelper struct {
	Type         string `json:"type"`
	SourceDir    string `json:"sourceDir"`
	ContainerDir string `json:"containerDir"`
	Mode         string `json:"mode"`
}

type CreateContainerReq struct {
	g.Meta          `path:"/container/create" method:"post" tags:"Create" summary:"Create a container."`
	ContainerId     string         `json:"containerId"`
	ForcePull       bool           `json:"forcePull"`
	Name            string         `json:"name" v:"required" dc:"container name"`
	Image           string         `json:"image" v:"required" dc:"image name"`
	Network         string         `json:"network"`
	Ipv4            string         `json:"ipv4"`
	Ipv6            string         `json:"ipv6"`
	PublishAllPorts bool           `json:"publishAllPorts"`
	ExposedPorts    []PortHelper   `json:"exposedPorts"`
	Tty             bool           `json:"tty"`
	OpenStdin       bool           `json:"openStdin"`
	Cmd             []string       `json:"cmd"`
	Entrypoint      []string       `json:"entrypoint"`
	CPUShares       int64          `json:"cpuShares"`
	NanoCPUs        float64        `json:"nanoCPUs"`
	Memory          float64        `json:"memory"`
	Privileged      bool           `json:"privileged"`
	AutoRemove      bool           `json:"autoRemove"`
	Volumes         []VolumeHelper `json:"volumes"`
	Labels          []string       `json:"labels"`
	Env             []string       `json:"env"`
	RestartPolicy   string         `json:"restartPolicy"`
}

type CreateContainerRes struct{}
